#ifndef WINDOWJS_STRINGS_H
#define WINDOWJS_STRINGS_H

#include <array>

#include <v8/include/v8.h>

enum class StringId {
  a,
  actualBoundingBoxAscent,
  actualBoundingBoxDescent,
  actualBoundingBoxLeft,
  actualBoundingBoxRight,
  addColorStop,
  addEventListener,
  addPath,
  alphabetic,
  Alt,
  altKey,
  AltLeft,
  AltRight,
  alwaysOnTop,
  antialias,
  arc,
  arcTo,
  args,
  ArrowDown,
  ArrowLeft,
  ArrowRight,
  ArrowUp,
  availHeight,
  availWidth,
  b,
  Backquote,
  Backslash,
  Backspace,
  base64ToArrayBuffer,
  basename,
  beginPath,
  bevel,
  bezierCurveTo,
  blur,
  bottom,
  BracketLeft,
  BracketRight,
  butt,
  button,
  c,
  cancelAnimationFrame,
  canvas,
  CanvasGradient,
  CanvasPattern,
  CanvasRenderingContext2D,
  CapsLock,
  center,
  clearRect,
  clearTimeout,
  click,
  clientX,
  clientY,
  clip,
  close,
  closePath,
  code,
  Codec,
  color,
  Comma,
  content,
  ContextMenu,
  Control,
  ControlLeft,
  ControlRight,
  copy,
  copyTree,
  cpus,
  createImageData,
  createLinearGradient,
  createPattern,
  createRadialGradient,
  ctrlKey,
  currentTransform,
  cursor,
  cursorOffsetX,
  cursorOffsetY,
  cwd,
  d,
  darken,
  data,
  debug,
  decode,
  decorated,
  Delete,
  deltaX,
  deltaY,
  devicePixelRatio,
  difference,
  Digit0,
  Digit1,
  Digit2,
  Digit3,
  Digit4,
  Digit5,
  Digit6,
  Digit7,
  Digit8,
  Digit9,
  dirname,
  drawImage,
  drop,
  e,
  ellipse,
  encode,
  end,
  End,  // Keep after | sort | uniq.
  Enter,
  Equal,
  error,
  Escape,
  exception,
  exclusion,
  exit,
  f,
  F1,
  F10,
  F11,
  F12,
  F13,
  F14,
  F15,
  F16,
  F17,
  F18,
  F19,
  F2,
  F20,
  F21,
  F22,
  F23,
  F24,
  F25,
  F3,
  F4,
  F5,
  F6,
  F7,
  F8,
  F9,
  File,
  files,
  fill,
  fillRect,
  fillStyle,
  fillText,
  focus,
  focused,
  font,
  fonts,
  frameBottom,
  frameLeft,
  frameRight,
  frameTop,
  fullscreen,
  g,
  getClipboardText,
  getImageData,
  getLineDash,
  getTransform,
  globalAlpha,
  globalCompositeOperation,
  h,
  hanging,
  height,
  Home,
  home,
  hue,
  i,
  icon,
  ideographic,
  imageSmoothingEnabled,
  imageSmoothingQuality,
  ImageBitmap,
  ImageData,
  Insert,
  isDir,
  isFile,
  isPointInPath,
  isPointInStroke,
  j,
  js,
  jsHeapSizeLimit,
  k,
  keepAspectRatio,
  key,
  KeyA,
  KeyB,
  KeyC,
  KeyD,
  keydown,
  KeyE,
  KeyF,
  KeyG,
  KeyH,
  KeyI,
  KeyJ,
  KeyK,
  KeyL,
  KeyM,
  KeyN,
  KeyO,
  KeyP,
  keypress,
  KeyQ,
  KeyR,
  KeyS,
  KeyT,
  KeyU,
  keyup,
  KeyV,
  KeyW,
  KeyX,
  KeyY,
  KeyZ,
  l,
  left,
  level,
  lighten,
  lighter,
  lineCap,
  lineDashOffset,
  lineJoin,
  lineTo,
  lineWidth,
  list,
  listTree,
  loadFont,
  location,
  log,
  luminosity,
  m,
  maximize,
  maximized,
  measureText,
  memory,
  message,
  Meta,
  metaKey,
  MetaLeft,
  MetaRight,
  middle,
  minimize,
  minimized,
  Minus,
  miter,
  miterLimit,
  mkdirs,
  mousedown,
  mouseenter,
  mouseleave,
  mousemove,
  mouseup,
  moveTo,
  multiply,
  n,
  now,
  NumLock,
  Numpad0,
  Numpad1,
  Numpad2,
  Numpad3,
  Numpad4,
  Numpad5,
  Numpad6,
  Numpad7,
  Numpad8,
  Numpad9,
  NumpadAdd,
  NumpadDecimal,
  NumpadDivide,
  NumpadEnter,
  NumpadMultiply,
  NumpadSubtract,
  o,
  offsetX,
  offsetY,
  open,
  overlay,
  overlayConsoleTextColor,
  p,
  PageDown,
  PageUp,
  parent,
  Path2D,
  Pause,
  performance,
  Period,
  platform,
  postMessage,
  PrintScreen,
  Process,
  profileFrameTimes,
  putImageData,
  q,
  quadraticCurveTo,
  Quote,
  r,
  readArrayBuffer,
  readImageBitmap,
  readImageData,
  readJSON,
  readText,
  rect,
  remove,
  removeEventListener,
  removeTree,
  rename,
  repeat,
  requestAnimationFrame,
  requestAttention,
  resetTransform,
  resizable,
  resize,
  restore,
  retinaScale,
  right,
  rotate,
  round,
  s,
  saturation,
  save,
  scale,
  screen,
  ScrollLock,
  Semicolon,
  sender,
  sep,
  setClipboardText,
  setLineDash,
  setTimeout,
  setTransform,
  shadowBlur,
  shadowColor,
  shadowOffsetX,
  shadowOffsetY,
  Shift,
  shiftKey,
  ShiftLeft,
  ShiftRight,
  showOverlayConsole,
  showOverlayConsoleOnErrors,
  showOverlayStats,
  size,
  Slash,
  Space,
  spawn,
  square,
  start,
  status,
  stroke,
  strokeRect,
  strokeStyle,
  strokeText,
  t,
  Tab,
  textAlign,
  textBaseline,
  title,
  tmp,
  toBase64,
  top,
  totalJSHeapSize,
  transform,
  translate,
  type,
  u,
  Unidentified,
  usedJSHeapSize,
  v,
  version,
  visible,
  vsync,
  w,
  wheel,
  width,
  window,
  write,
  x,
  y,
  z,
  __dirname,
  __filename,

  _0_,
  _1_,
  _2_,
  _3_,
  _4_,
  _5_,
  _6_,
  _7_,
  _8_,
  _9_,
  _BACK_QUOTE_,
  _BACK_SLASH_,
  _COMMA_,
  _DOT_,
  _EMPTY_,
  _EQUAL_,
  _FORWARD_SLASH_,
  _LEFT_BRACKET_,
  _MINUS_,
  _PLUS_,
  _QUOTE_,
  _RIGHT_BRACKET_,
  _SEMICOLON_,
  _SPACE_,
  _STAR_,
  _XOR_,
  colorBurn,
  colorDodge,
  destinationAtop,
  destinationIn,
  destinationOut,
  destinationOver,
  hardLight,
  softLight,
  sourceAtop,
  sourceIn,
  sourceOut,
  sourceOver,

  LAST_STRING_ID,
};

class JsStrings final {
 public:
  explicit JsStrings(v8::Isolate* isolate);
  ~JsStrings();

  v8::Local<v8::String> GetConstantString(StringId id, v8::Isolate* isolate) {
    return strings_[static_cast<int>(id)].Get(isolate);
  }

 private:
  std::array<v8::Eternal<v8::String>,
             static_cast<int>(StringId::LAST_STRING_ID)>
      strings_;
};

#endif  // WINDOWJS_STRINGS_H
